<?php

class User_Controller_Browse_Index extends Nuo_Controller
{

	function execute($request)
	{
		$part = $request -> getUriPart(1);

		if ($part && is_id($part))
		{
			$request -> setParam('user_id', $part);
			$request -> forward('user/controller/browse/profile');
			return;
		}

		$table = Nuo::getTable('user');

		$select = $table -> select();

		$paging = Nuo_Paging::factory($select, $request -> getParam('page', 1), 20);

		return  $this -> render(array(
			'paging' => $paging,
			'count' => $paging -> getItemCount()
		));
	}

}
